package com.android.settings.audio.peq.peq;

public class Band {
    public int index;
    public boolean on;
    public String title;
    public boolean isSelected;
    public int freq = 30 * 100;//30*100 - 20000*100
    public int q = (int) (0.2 * 100 * 100);//0.2*100 - 20*100
    public int gain;
    /*private double preAmp;*/
    public int filterType;

    public Band(int index, String title) {
        this.index = index;
        this.title = title;
    }

    public double getFreq() {
        return freq / 100f;
    }

    public double getQ() {
        return q / 100f / 100;
    }

    public double getGain() {
        return gain / 100f / 100;
    }

    public void setFreq(double freq) {
        this.freq = (int) (freq * 100);
    }

    public void setQ(double q) {
        this.q = (int) (q * 100 * 100);
    }

    public void setGain(double gain) {
        this.gain = (int) (gain * 100 * 100);
    }

    public void setOn(int on) {
        this.on = on == 1;
    }

    public void setFilterType(int filterType) {
        this.filterType = filterType;
    }

    @Override
    public String toString() {
        return "Band{" +
                "index=" + index +
                ", on=" + on +
                ", title='" + title + '\'' +
                ", isSelected=" + isSelected +
                ", freq=" + freq +
                ", q=" + q +
                ", gain=" + gain +
                ", filterType=" + filterType +
                '}';
    }
}